<!DOCTYPE html>
<html>
<head>
	<title>商品列表</title>
	<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
	<style type="text/css">
		body { margin: 20 auto 0 auto; }
	</style>
</head>
<body>
<?php
	$tags = [
		1 => '热门',
		2 => '最新',
	];
?>
<div class="btn-group">
	<a href="/admin_1427a/mall/goods" class="btn btn-default active" role="button">所有商品</a>
	<a href="/admin_1427a/mall/order" class="btn btn-default" role="button">兑换订单</a>
	<a href="/admin_1427a/mall/edit" class="btn btn-default" role="button">添加商品</a>
</div>
<table class="table table-bordered">
	<tr>
		<th>id</th>
		<th>名称</th>
		<th>图片</th>
		<th>缩略图</th>
		<th>价格</th>
		<th>参与价</th>
		<th>需小妖币</th>
		<th>需金币</th>
		<th>类型</th>
		<th>标签</th>
		<th>描述</th>
		<th>操作</th>
	</tr>
	@foreach($list as $goods)
		<tr>
			<td>{{ $goods->id }}</td>
			<td>{{ $goods->name }}</td>
			<td><img src="{{ $goods->images }}" width="100" /></td>
			<td><img src="{{ $goods->thumbnail }}" width="100" /></td>
			<td>{{ $goods->price }}</td>
			<td>{{ $goods->original_price }}</td>
			<td>{{ $goods->need_xyb }}</td>
			<td>{{ $goods->need_jb }}</td>
			<td>
				@foreach($goods->types as $t)
				{{ $t->name }}
				@endforeach
			</td>
			<td>{{ $tags[$goods->tag] }}</td>
			<td>{{ $goods->description }}</td>
			<td>
				<a href="/admin_1427a/mall/edit?id={{$goods->id}}" class="btn btn-default" role="button">修改商品</a>
			</td>
		</tr>
	@endforeach
</table>
{{ $list->appends($params)->links() }}
</body>
</html>
